import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from "vuex-persistedstate"
//使用vuex插件
Vue.use(Vuex)
export default new Vuex.Store({
  //全局状态
  state: {
    loginUserName: '一汽解放'
  },
  //同步数据提交
  mutations: {
    updateLoginUserName(state, param) {
      state.loginUserName = param;
    }
  },
  //引入持久化组件
  plugins: [createPersistedState()]
})
